#ifndef __DYNAMICARRAY_H_
#define __DYNAMICARRAY_H_

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#define ElementType void*   //万能动态数组

//隐藏结构体成员变量
struct DynamicArray;    //结构体声明

typedef struct DynamciArray DArray;

DArray* InitDArray();
//
void InsertDArray(DArray *a,ElementType element);
void PrintDArray(DArray *a,void (*print)(ElementType));
ElementType FindByElement(DArray *a,ElementType value,bool(*compare)(ElementType,ElementType));
// void RemoveDArray(DArray *a, ElementType value, bool (*compare)(ElementType, ElementType));
ElementType RemoveDArray(DArray *a,ElementType value,bool(*compare)(ElementType,ElementType));
void ClearDArray(DArray *a,void (*clear)(ElementType));
//void FastSort(DArray *a,bool bool(*compare)(ElementType,ElementType));
void BinarySearch(DArray *a,ElementType value,bool(*compare)(ElementType,ElementType));

#endif